﻿using D.Medicalcare.Domain.Entities;
using D.Medicalcare.ErrorCode;
using D.Medicalcare.Read.API.Application.Command.HealthCheckPackageCommand;
using D.Medicalcare.Read.API.Application.Command.MenuCommand;
using D.Medicalcare.Read.API.Dtos;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace D.Medicalcare.Read.API.Controllers
{
    /// <summary>
    /// 体验套餐控制器-读
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class HealthCheckPackageController : ControllerBase
    {
        private readonly IMediator mediator;
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="mediator">中介者</param>

        public HealthCheckPackageController(IMediator mediator)
        {
            this.mediator = mediator;
        }

        /// <summary>
        /// 获取体验套餐列表
        /// </summary>
        /// <param name="request">请求</param>
        /// <returns></returns>
        [HttpGet]
        public async Task<APIPaging<HealthCheckPackage>> GetHealthCheckPackage([FromQuery]GetHealthCheckPackageCommand request)
        {
            try
            {
                return await mediator.Send(request);
            }
            catch (Exception)
            {

                throw;
            }
        }
    }
}
